package api

import (
	"developer-branch/api/handler"
	jwt "developer-branch/pkg"
	"github.com/gin-gonic/gin"
)

func Router(r *gin.Engine) {
	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("/up", handler.UserUp) // 登录
			user.GET("/list", handler.UserList)
		}
		chat := api.Group("/chat")
		{
			chat.POST("/chathistory", handler.ChatHistory)
			chat.GET("/chatlist", handler.ChatList)
			chat.Use(jwt.JWTAuth("2210y"))
			chat.GET("/chat", handler.Chat)
		}
		room := api.Group("/room")
		{
			room.POST("/roomUserAdd", handler.RoomUserAdd)
			room.Use(jwt.JWTAuth("2210y"))
			room.POST("/roomCreate", handler.RoomCreate)

		}
	}
}
